diff options
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r-- | test/CMakeLists.txt | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7715cac..dea5547 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,12 +1,18 @@ +PROJECT(connection_test C) + SET(fw_test "${fw_name}-test") +SET(dependents "capi-base-common glib-2.0 network") +SET(pc_dependents "capi-base-common") + INCLUDE(FindPkgConfig) -pkg_check_modules(${fw_test} REQUIRED glib-2.0) +pkg_check_modules(${fw_test} REQUIRED ${dependents}) FOREACH(flag ${${fw_test}_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") aux_source_directory(. sources) FOREACH(src ${sources}) @@ -15,3 +21,5 @@ FOREACH(src ${sources}) ADD_EXECUTABLE(${src_name} ${src}) TARGET_LINK_LIBRARIES(${src_name} ${fw_name} ${${fw_test}_LDFLAGS}) ENDFOREACH() + +INSTALL(TARGETS connection_test RUNTIME DESTINATION bin/) |